<?php
$fecha1 = $_GET['fecha1'];
$fecha2 = $_GET['fecha2'];
$matricula = $_GET['matricula'];
$cochera = $_GET['cochera'];
require_once '../Controlador/controladoraEvento.php';
$cE = ControladoraEvento::getInstance();
$val = 0;
if ($cochera != '') {
    $val = '3';
} elseif ($matricula != '') {
    $val = '2';
} else {
    $val = '1';
}
$x = array($val, $fecha1, $fecha2, $matricula, $cochera);
$restec = $cE->reportarEventos($x);
//var_dump($res);
$ultimo = count($restec);
?>

<div style="margin-top: 100px;margin-left: 305px; height: 310px;overflow-y: auto;width: 600px; "id="tablita">

    <table border="1" width="auto" style="">
        <tr><th>Hora</th><th>Fecha</th><th>Tipo</th><th>Matricula</th><th>Cochera</th></tr>
        <?php
        for ($i = 0; $i < $ultimo; $i++) {
            $event = $restec[$i];
            ?>
            <tr>
                <td><?php echo $event[0] ?></td>
                <td><?php echo $event[1] ?></td>
                <td><?php echo $event[2] ?></td>
                <td><?php echo $event[3] ?></td>
                <td><?php echo $event[4] ?></td>
            </tr>
            <?php
        }
        ?>
    </table>
</div>
<div id="aux">

</div>